<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');?>
<div class='container'>
     <div class="tabbable"> <!-- Only required for left/right tabs -->
	<?=$tab_header;?>
       <div class="tab-content" style='height:450px;'>
        <div class="btn-group">
        <a class="btn btn-small dropdown-toggle" data-toggle="dropdown" href="#">Sort by
        <span class="caret"></span>
        </a>
        <ul class="dropdown-menu">
            <li><a href='#' onclick="_aksi('id_klass');"><i class='cus-star'></i> ID Sub Klas </a></li>
            <li><a href='#' onclick="_aksi('nm_klass');"><i class='cus-star'></i> Description</a></li>
        </ul>
		 </div>
		 <!--<div class='btn-group'>
		 <label class="checkbox">
		 <input type="checkbox" onclick="_show_del();"> Show Deleted Data
		 </label>
		</div>
		<form class="navbar-form pull-right">
		<input type="text" id='cari' class="span3" placeholder="find by name">
		<button type="button" class="btn btn-small" onClick='_cari();'><i class='cus-find'></i></button>
		</form>-->
		 <hr />
         <div class="tab-pane active" id="table1"><?=$this->zetro_auth->allAuth($list,'akun_sub_klasifikasi');?></div>
       </div>
    </div>
<?=$modal;?>    
</div>
<input type='hidden' id='edited' name='edited' value=''/>
<? link_js('jquery.fixedheader','asset/js/');?>
<script language="javascript">
	$(document).ready(function(e) {
		$('a#p-table2').click(function(){
			jPrompt('Input Deskripsi Klasifikasi','','Add New Klasifikasi',function(r)
			{
				if(r)
				{
					$.post('set_subklasifikasi',{'nm_klass':r},
					function(result){
						document.location.reload();
					})
				}
			});
		});
		_show_data();
	});
	
	function _aksi(id)
	{
		_show_data(id);
	}

	function _show_data(tp)
	{
		show_indicator('NewList',3);
		$.post('get_subklasifikasi',{'ord_by':tp},
		function(result){
			$('#NewList tbody').html(result);
			(tp=='')?
			$('#NewList').fixedHeader({'width':($('div#table2').width()-300),'height':400}):'';
		})
	}
	function btn_click(id,aksi)
	{
		switch(aksi)
		{
			case 'edit':
			break;
			case 'deleted':
			jConfirm('Yakin akan menghapus data sub klasifikasi ini','Alert',function(r){
				if(r)
				{
					$.post('del_subklasifikasi',{'id':id},
					function(result){
						_show_data('id_klass');
					})
				}
			})
			break;
			case 'del':
			var msg="Data sub klasifikasi sedang digunakan di kode akun\n";
				msg+="Hapus terlebih dahulu sub klasifikasi ini dari Kode Akun\n";
				msg+="sebelum menghapus dari daftar ini";
			jAlert(msg,'Ziebar Message');
			break;
		}
	}
</script>
